Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Percolate API request parsing issue #4325

Closed
pdesoyres opened this issue Dec 3, 2013 · 1 comment
Closed

Percolate API request parsing issue #4325

pdesoyres opened this issue Dec 3, 2013 · 1 comment
Assignees

Comments

@pdesoyres
Copy link

I experiment strange behaviour using percolate API using fresh 1.0.0-Beta2 elasticsearch :

First, I index a new percolate query :

curl -XPUT 'localhost:9200/my-index/.percolator/1' -d '{
    "query" : {
        "match" : {
            "message" : "bonsai tree"
        }
    }
}'

Then when I use Percolate API :

 curl -XGET 'localhost:9200/my-index/message/_percolate' -d '{
     "doc" : {
         "message" : "A new bonsai tree in the office"
     },
     "score":true
 }'

note the usage of score:true

I get a result without score :

{
    "took": 5,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "total": 1,
    "matches": [
        {
            "_index": "my-index",
            "_id": "1"
        }
    ]
}

But if I change the location of the parameter score in the query :

 curl -XGET 'localhost:9200/my-index/message/_percolate' -d '{
     "score":true,
     "doc" : {
         "message" : "A new bonsai tree in the office"
     }
 }'

Then, I get the expected result :

{
    "took": 39,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "total": 1,
    "matches": [
        {
            "_index": "my-index",
            "_id": "1",
            "_score": 1
        }
    ]
}

I experiment the same behaviour with the highlight and size parameters.

@ghost ghost assigned martijnvg Dec 3, 2013
@martijnvg
Copy link
Member

@pdesoyres Thanks for reporting this bug, I've pushed a fix for this, which will be included in the next 1.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants